home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / CPlusIncludes / Menus.h < prev    next >
Text File  |  1991-05-01  |  6KB  |  192 lines

  1. /************************************************************
  2.  
  3. Created: Sunday, January 6, 1991 at 9:31 PM
  4.     Menus.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __MENUS__
  15. #define __MENUS__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #ifndef __GEOMETRY__
  22. #include <Geometry.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.  
  29. #define noMark '\0'         /*mark symbol for MarkItem*/
  30.  
  31. /* menu defProc messages */
  32.  
  33.     mDrawMsg = 0,
  34.     mChooseMsg = 1,
  35.     mSizeMsg = 2,
  36.     mDrawItemMsg = 4,
  37.     mCalcItemMsg = 5,
  38.     textMenuProc = 0,
  39.     hMenuCmd = 27,          /*itemCmd == 0x001B ==> hierarchical menu*/
  40.     hierMenu = -1,          /*a hierarchical menu - for InsertMenu call*/
  41.     mPopUpMsg = 3,          /*menu defProc messages - place yourself*/
  42.     mctAllItems = -98,      /*search for all Items for the given ID*/
  43.     mctLastIDIndic = -99    /*last color table entry has this in ID field*/
  44. };
  45.  
  46. struct MenuInfo {
  47.     short menuID;
  48.     short menuWidth;
  49.     short menuHeight;
  50.     Handle menuProc;
  51.     long enableFlags;
  52.     Str255 menuData;
  53. };
  54.  
  55. typedef MenuInfo *MenuPtr, **MenuHandle;
  56.  
  57. struct MCEntry {
  58.     short mctID;            /*menu ID.  ID = 0 is the menu bar*/
  59.     short mctItem;          /*menu Item. Item = 0 is a title*/
  60.     RGBColor mctRGB1;       /*usage depends on ID and Item*/
  61.     RGBColor mctRGB2;       /*usage depends on ID and Item*/
  62.     RGBColor mctRGB3;       /*usage depends on ID and Item*/
  63.     RGBColor mctRGB4;       /*usage depends on ID and Item*/
  64.     short mctReserved;      /*reserved for internal use*/
  65. };
  66.  
  67. typedef struct MCEntry MCEntry;
  68. typedef MCEntry *MCEntryPtr;
  69.  
  70.  
  71. /**/
  72.  
  73. typedef MCEntry MCTable[1], *MCTablePtr, **MCTableHandle;
  74.  
  75. struct MenuCRsrc {
  76.     short numEntries;       /*number of entries*/
  77.     MCTable mcEntryRecs;    /*ARRAY [1..numEntries] of MCEntry*/
  78. };
  79.  
  80. typedef struct MenuCRsrc MenuCRsrc;
  81. typedef MenuCRsrc *MenuCRsrcPtr, **MenuCRsrcHandle;
  82.  
  83.  
  84. #ifdef __cplusplus
  85. extern "C" {
  86. #endif
  87. pascal void InitMenus(void)
  88.     = 0xA930; 
  89. pascal MenuHandle NewMenu(short menuID,const Str255& menuTitle)
  90.     = 0xA931; 
  91. pascal MenuHandle GetMenu(short resourceID)
  92.     = 0xA9BF; 
  93. pascal void DisposeMenu(MenuHandle theMenu)
  94.     = 0xA932; 
  95. pascal void AppendMenu(MenuHandle menu,ConstStr255Param data)
  96.     = 0xA933; 
  97. pascal void AddResMenu(MenuHandle theMenu,ResType theType)
  98.     = 0xA94D; 
  99. pascal void InsertResMenu(MenuHandle theMenu,ResType theType,short afterItem)
  100.     = 0xA951; 
  101. pascal void InsertMenu(MenuHandle theMenu,short beforeID)
  102.     = 0xA935; 
  103. pascal void DrawMenuBar(void)
  104.     = 0xA937; 
  105. pascal void InvalMenuBar(void)
  106.     = 0xA81D; 
  107. pascal void DeleteMenu(short menuID)
  108.     = 0xA936; 
  109. pascal void ClearMenuBar(void)
  110.     = 0xA934; 
  111. pascal Handle GetNewMBar(short menuBarID)
  112.     = 0xA9C0; 
  113. pascal Handle GetMenuBar(void)
  114.     = 0xA93B; 
  115. pascal void SetMenuBar(Handle menuList)
  116.     = 0xA93C; 
  117. pascal void InsMenuItem(MenuHandle theMenu,ConstStr255Param itemString,
  118.     short afterItem)
  119.     = 0xA826; 
  120. pascal void DelMenuItem(MenuHandle theMenu,short item)
  121.     = 0xA952; 
  122. pascal long MenuKey(short ch)
  123.     = 0xA93E; 
  124. pascal void HiliteMenu(short menuID)
  125.     = 0xA938; 
  126. pascal void SetItem(MenuHandle theMenu,short item,ConstStr255Param itemString)
  127.     = 0xA947; 
  128. pascal void GetItem(MenuHandle theMenu,short item,Str255& itemString)
  129.     = 0xA946; 
  130. pascal void DisableItem(MenuHandle theMenu,short item)
  131.     = 0xA93A; 
  132. pascal void EnableItem(MenuHandle theMenu,short item)
  133.     = 0xA939; 
  134. pascal void CheckItem(MenuHandle theMenu,short item,Boolean checked)
  135.     = 0xA945; 
  136. pascal void SetItemMark(MenuHandle theMenu,short item,short markChar)
  137.     = 0xA944; 
  138. pascal void GetItemMark(MenuHandle theMenu,short item,short& markChar)
  139.     = 0xA943; 
  140. pascal void SetItemIcon(MenuHandle theMenu,short item,short iconIndex)
  141.     = 0xA940; 
  142. pascal void GetItemIcon(MenuHandle theMenu,short item,short& iconIndex)
  143.     = 0xA93F; 
  144. pascal void SetItemStyle(MenuHandle theMenu,short item,short chStyle)
  145.     = 0xA942; 
  146. pascal void GetItemStyle(MenuHandle theMenu,short item,Style& chStyle); 
  147. pascal void CalcMenuSize(MenuHandle theMenu)
  148.     = 0xA948; 
  149. pascal short CountMItems(MenuHandle theMenu)
  150.     = 0xA950; 
  151. pascal MenuHandle GetMHandle(short menuID)
  152.     = 0xA949; 
  153. pascal void FlashMenuBar(short menuID)
  154.     = 0xA94C; 
  155. pascal void SetMenuFlash(short count)
  156.     = 0xA94A; 
  157. pascal long MenuSelect(Point startPt)
  158.     = 0xA93D; 
  159. pascal void InitProcMenu(short resID)
  160.     = 0xA808; 
  161. pascal void GetItemCmd(MenuHandle theMenu,short item,short& cmdChar)
  162.     = 0xA84E; 
  163. pascal void SetItemCmd(MenuHandle theMenu,short item,short cmdChar)
  164.     = 0xA84F; 
  165. pascal long PopUpMenuSelect(MenuHandle menu,short top,short left,short popUpItem)
  166.     = 0xA80B; 
  167. pascal long MenuChoice(void)
  168.     = 0xAA66; 
  169. pascal void DelMCEntries(short menuID,short menuItem)
  170.     = 0xAA60; 
  171. pascal MCTableHandle GetMCInfo(void)
  172.     = 0xAA61; 
  173. pascal void SetMCInfo(MCTableHandle menuCTbl)
  174.     = 0xAA62; 
  175. pascal void DispMCInfo(MCTableHandle menuCTbl)
  176.     = 0xAA63; 
  177. pascal MCEntryPtr GetMCEntry(short menuID,short menuItem)
  178.     = 0xAA64; 
  179. pascal void SetMCEntries(short numEntries,MCTablePtr menuCEntries)
  180.     = 0xAA65; 
  181. MenuHandle newmenu(short menuID,char *menuTitle); 
  182. void getitem(MenuHandle menu,short item,char *itemString); 
  183. void appendmenu(MenuHandle menu,char *data); 
  184. void insmenuitem(MenuHandle theMenu,char *itemString,short afterItem); 
  185. long menuselect(Point *startPt); 
  186. void setitem(MenuHandle menu,short item,char *itemString); 
  187. #ifdef __cplusplus
  188. }
  189. #endif
  190.  
  191. #endif
  192.